package com.funo.business.entities;
// default package

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;


/**
 * Product entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="T_PRODUCT"
    ,schema="UNIBASE"
)
@DynamicInsert
@DynamicUpdate
public class Product  implements java.io.Serializable {


    // Fields    

     private String productId;
     private String productName;
     private String brand;
     private Double price;
     private String description;
     private int isValid;
     private String photo;
     private Date insertDt;
     
     private ProductItem productItem;

    // Constructors

    /** default constructor */
    public Product() {
    }

    
    /** full constructor */
    public Product(String productName, ProductItem productItem, String brand, Double price, String description, String photo) {
        this.productName = productName;
        this.brand = brand;
        this.price = price;
        this.description = description;
        this.photo = photo;
        this.productItem = productItem;
    }

   
    // Property accessors
    //@GenericGenerator(name="generator", strategy="uuid.hex")@Id @GeneratedValue(generator="generator")
    @Id
    @Column(name="PRODUCT_ID", unique=true, nullable=false, length=40)

    public String getProductId() {
        return this.productId;
    }
    
    public void setProductId(String productId) {
        this.productId = productId;
    }
    
    @Column(name="PRODUCT_NAME", nullable=false, length=32)

    public String getProductName() {
        return this.productName;
    }
    
    public void setProductName(String productName) {
        this.productName = productName;
    }
    
    @Column(name="BRAND", length=32)

    public String getBrand() {
        return this.brand;
    }
    
    public void setBrand(String brand) {
        this.brand = brand;
    }
    
    @Column(name="PRICE", precision=38)

    public Double getPrice() {
        return this.price;
    }
    
    public void setPrice(Double price) {
        this.price = price;
    }
    
    @Column(name="DESCRIPTION", length=200)

    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    @Column(name="IS_VALID", nullable=false, precision=1, scale=0,insertable=false)

    public int getIsValid() {
        return this.isValid;
    }
    
    public void setIsValid(int isValid) {
        this.isValid = isValid;
    }
    
    @Column(name="PHOTO", length=200)

    public String getPhoto() {
        return this.photo;
    }
    
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="INSERT_DT", length=7,insertable=false,updatable=false)

    public Date getInsertDt() {
        return this.insertDt;
    }
    
    public void setInsertDt(Date insertDt) {
        this.insertDt = insertDt;
    }

    @ManyToOne
    @JoinColumn(name = "PRODUCT_ITEM_ID")
	public ProductItem getProductItem() {
		return productItem;
	}


	public void setProductItem(ProductItem productItem) {
		this.productItem = productItem;
	}
   








}